#ifndef CRECIPEINGREDIENT_H
#define CRECIPEINGREDIENT_H

#include <QObject>
#include "cobject.h"
namespace cooking {

class CRecipeIngredient : public CObject
{
    Q_OBJECT
    Q_PROPERTY(int ingredientId READ ingredientId WRITE setIngredientId NOTIFY ingredientIdChanged)
    Q_PROPERTY(int recipeId READ recipeId WRITE setRecipeId NOTIFY recipeIdChanged)
    Q_PROPERTY(double customQuantity READ customQuantity WRITE setCustomQuantity NOTIFY customQuantityChanged)
    Q_PROPERTY(int customUnitTypeId READ customUnitTypeId WRITE setCustomUnitTypeId NOTIFY customUnitTypeIdChanged)
    Q_PROPERTY(double quantity READ quantity WRITE setQuantity NOTIFY quantityChanged)
public:
    explicit CRecipeIngredient(QObject *parent = 0);

    int ingredientId();
    void setIngredientId(int ingredientId);

    int recipeId();
    void setRecipeId(int recipeId);

    int customUnitTypeId();
    void setCustomUnitTypeId(int unitTypeId);

    double customQuantity();
    void setCustomQuantity(double quantity);

    double quantity();
    void setQuantity(double quantity);

signals:
//    void idChanged();
    void ingredientIdChanged();
    void recipeIdChanged();
    void customQuantityChanged();
    void customUnitTypeIdChanged();
    void quantityChanged();

public slots:
private:
    int m_ingredient_id;
    int m_recipe_id;
    int m_custom_quantity;
    int m_custom_unit_type_id;
    double m_quantity;
};
} // namespace cooking
#endif // CRECIPEINGREDIENT_H
